uthor : ytu
#Desc : restart tomcat
#Time : 2016-05-30
#重新启动项目

#tomcat安装目录 
tomcatpath="/usr/local/tomcat/tomcat-weixin/"
#工程名称
tomcatname="weixin-web"
#工程目录
webappath="/home/tomcat/apps/eshop-weixin"
#工程压缩包路径
warpath="/home/tomcat/eshop-weixin.war"

ps -ef | grep java | grep ${tomcatpath};
pid=$(ps -ef | grep java | grep ${tomcatpath} | awk '{print $2}')
rm -rf ${tomcatpath}work/Catalina/localhost/*
#kill进程
if  ["$pid" =  ] ;then
    echo "nextLine${tomcatname} process was killed already!"
else
	kill -9 $pid
	echo "nextLine----------------------------------- kill $pid success-----------------------------------"
fi

echo "nextLine start Tomcat"
#启动tomcat
sh /usr/local/tomcat/tomcat-weixin/bin/startup.sh
#打印日志
#tail -f ${tomcatpath}logs/catalina.out
echo "nextLine tomcat start success"


